Skip to content

Improve session usage reporting and quick action localization#655

Merged
limityan merged 3 commits intoGCWing:mainfrom
limityan:yanzhn/usage
May 11, 2026
Merged

Improve session usage reporting and quick action localization#655
limityan merged 3 commits intoGCWing:mainfrom
limityan:yanzhn/usage

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

Summary

This PR completes the P1 session usage reporting work and localizes the built-in Commit / Create PR quick actions.

It makes session usage reports rely on persisted runtime facts instead of only best-effort tool traces, adds a richer Chat/detail UI for inspecting usage, files, tools, errors, and slow spans, and improves the UX around incomplete or legacy report data.

What Changed

Runtime Usage Data

  • Persist richer session usage facts from runtime events, including model rounds, token usage, tool execution timing, and file-related activity.
  • Extend session history/API contracts so usage reports can reconstruct more reliable per-session statistics.
  • Prevent the local usage-report action itself from polluting the measured session span.
  • Add report coverage/accounting metadata so the UI can clearly communicate when data is complete, partial, approximate, or unavailable.
  • Improve legacy/missing model identity handling so old sessions no longer show unclear labels such as model round 0.

Chat Usage Report UX

  • Move the usage report entry point into the Chat input footer.
  • Add a compact session usage card in Chat with clearer metrics, token labels, file summaries, tool summaries, and detail-entry affordances.
  • Make the usage report action visually lighter and theme-aware while keeping it discoverable.
  • Keep unavailable token/model values from being combined with misleading token units.

Detail Panel

  • Add a tabbed session usage detail panel for overview, models, tools, files, errors, and slow spans.
  • Add snapshot-backed file diff actions from the files tab.
  • Make file paths compact in tables/cards while preserving full paths in tooltips.
  • Improve long-table ergonomics so the diff action remains reachable.
  • Add turn-jump behavior for slow spans where a concrete session turn exists.
  • Improve missing-duration and unavailable-data presentation with quieter visual treatment and explanatory tooltips.

Localization

  • Add/adjust English, Simplified Chinese, and Traditional Chinese copy for the new usage report UI.
  • Normalize the usage metric label to Tokens.
  • Localize built-in Commit and Create PR quick action labels/prompts through reusable quick-action localization helpers.

Documentation

  • Update the session runtime usage report design document with the current P1 implementation shape, entry point, known coverage boundaries, and follow-up direction.

Reviewer Notes

  • The branch is intentionally split into three commits:
    1. feat(usage): persist runtime report facts
    2. feat(usage): add report details and diff actions
    3. feat(i18n): localize quick action labels
  • The usage report still exposes coverage/accounting state because some historical sessions or providers may not have complete runtime metadata.
  • Existing Rust checks currently report a pre-existing unused import warning in src/apps/desktop/src/tray.rs; this PR does not modify that area.

Validation

  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run
  • cargo check --workspace
  • cargo test --workspace
  • git diff --check origin/main..HEAD

@limityan limityan merged commit 79304aa into GCWing:main May 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant